package com.chendx.behavior.controller.v1;

import com.chendx.api.behavior.ApBehaviorEntryControllerApi;
import com.chendx.behavior.service.ApBehaviorEntryService;
import com.chendx.model.behavior.dtos.BehaviorEntryDto;
import com.chendx.model.behavior.pojos.ApBehaviorEntry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by chendx on 2022/3/8.
 */
@RestController
@RequestMapping("/api/v1")
public class ApBehaviorEntryController implements ApBehaviorEntryControllerApi {

    @Autowired
    private ApBehaviorEntryService apBehaviorEntryService;

    @Override
    @PostMapping("/behavior_entry")
    public ApBehaviorEntry findByUserIdOrEquipmentId(@RequestBody BehaviorEntryDto dto) {
        return apBehaviorEntryService.findByUserIdOrEquipmentId(dto.getUserId(),null);
    }
}
